import Vue from 'vue'
import App from './App.vue'
//路由
import router from './router'
//饿了吗
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
//全局样式表
import './style/global.css'
//处理时间
import Moment from 'moment'

import 'moment/locale/zh-cn'

//引入阿里巴巴icon
import './assets/fonts/iconfont.css'

//引用注册charts
import * as echarts from 'echarts'
Vue.prototype.$echarts = echarts

//引入Markdown编辑器

import mavonEditor from 'mavon-editor'
import 'mavon-editor/dist/css/index.css'

import store from './store/index'

// use
Vue.use(mavonEditor)

//全局时间过滤器
//相对时间
Vue.filter('formatDate', function (value) {
  return Moment(value).fromNow()
})

//绝对时间
Vue.filter('formatDate1', function (value) {
  return Moment(value).format('ll')
})

//引入mock
require('./utils/mock/index')

Vue.config.productionTip = false

Vue.use(ElementUI)

new Vue({
  router,
  store,
  render: (h) => h(App)
}).$mount('#app')
